<?php
/**
 *  Index Page
 *
 *  @author $Author: jinsonxu@gmail.com $:
 *  $Date: 2014-11-09 22:57:19 +0000 (Sun, 09 Nov 2014) $:
 *  $Id: index.php 6 2014-11-09 22:57:19Z jinsonxu@gmail.com $:
 *  @version $Rev: 6 $:
 */

include('bootstrap.php');

//imports
use org\crawlgenie\application\path\Path;
use org\crawlgenie\application\base\Application;
use org\crawlgenie\application\base\Factory;
use org\crawlgenie\application\environment\Request;
use org\crawlgenie\application\environment\RequestLogger;


try {

    $application = new Application();
    $application->setStartTime();

    $module = Request::getParam('mod') != null ? Path::getCleanPath(Request::getParam('mod')) : 'default';
    $modControllerName = 'org\\crawlgenie\\modules\\' . $module . '\\' . ucwords($module) . 'Controller';
	
    $moduleController = new $modControllerName();
    $moduleController->execute();

    RequestLogger::logRequest($application);

} catch (CGException $e) {
    RequestLogger::logRequest($application);
    $e->CGExit(CGConfig::$displayErrors);
}



?>